// To parse this JSON data, do
//
//     final paymentRecord = paymentRecordFromJson(jsonString);

import 'dart:convert';

// this is for Aplus
PaymentRecord paymentRecordFromJson(String str) =>
    PaymentRecord.fromJson(json.decode(str));

String paymentRecordToJson(PaymentRecord data) => json.encode(data.toJson());

class PaymentRecord {
  PaymentRecord({
    this.status,
    this.message,
    this.result,
  });

  int? status;
  String? message;
  Result? result;

  factory PaymentRecord.fromJson(Map<String, dynamic> json) => PaymentRecord(
        status: json["status"],
        message: json["message"],
        result: json["result"] == null ? null : Result.fromJson(json["result"]),
      );

  Map<String, dynamic> toJson() => {
        "status": status,
        "message": message,
        "result": result?.toJson(),
      };
}

class Result {
  Result({
    this.limit,
    this.count,
    this.page,
    this.list,
  });

  int? limit;
  int? count;
  int? page;
  List<ListElement>? list;

  factory Result.fromJson(Map<String, dynamic> json) => Result(
        limit: json["limit"],
        count: json["count"],
        page: json["page"],
        list: json["list"] == null
            ? []
            : List<ListElement>.from(
                json["list"]!.map((x) => ListElement.fromJson(x))),
      );

  Map<String, dynamic> toJson() => {
        "limit": limit,
        "count": count,
        "page": page,
        "list": list == null
            ? []
            : List<dynamic>.from(list!.map((x) => x.toJson())),
      };
}

class ListElement {
  ListElement({
    this.unitPrice,
    this.lastName,
    this.updateDate,
    this.studentNumber,
    this.ipAddress,
    this.tax,
    this.platform,
    this.quoteNumber,
    this.firstName,
    this.paymentItem,
    this.details,
    this.id,
    this.subtotalPrice,
    this.paymentTerm,
    this.email,
    this.createDate,
    this.status,
  });

  double? unitPrice;
  String? lastName;
  int? updateDate;
  int? studentNumber;
  String? ipAddress;
  int? tax;
  String? platform;
  String? quoteNumber;
  String? firstName;
  String? paymentItem;
  List<Detail>? details;
  String? id;
  double? subtotalPrice;
  int? paymentTerm;
  String? email;
  int? createDate;
  String? status;

  factory ListElement.fromJson(Map<String, dynamic> json) => ListElement(
        unitPrice: json["unitPrice"]?.toDouble(),
        lastName: json["lastName"],
        updateDate: json["updateDate"],
        studentNumber: json["studentNumber"],
        ipAddress: json["ipAddress"],
        tax: json["tax"],
        platform: json["platform"],
        quoteNumber: json["quoteNumber"],
        firstName: json["firstName"],
        paymentItem: json["paymentItem"],
        details: json["details"] == null
            ? []
            : List<Detail>.from(
                json["details"]!.map((x) => Detail.fromJson(x))),
        id: json["id"],
        subtotalPrice: json["subtotalPrice"]?.toDouble(),
        paymentTerm: json["paymentTerm"],
        email: json["email"],
        createDate: json["createDate"],
        status: json["status"],
      );

  Map<String, dynamic> toJson() => {
        "unitPrice": unitPrice,
        "lastName": lastName,
        "updateDate": updateDate,
        "studentNumber": studentNumber,
        "ipAddress": ipAddress,
        "tax": tax,
        "platform": platform,
        "quoteNumber": quoteNumber,
        "firstName": firstName,
        "paymentItem": paymentItem,
        "details": details == null
            ? []
            : List<dynamic>.from(details!.map((x) => x.toJson())),
        "id": id,
        "subtotalPrice": subtotalPrice,
        "paymentTerm": paymentTerm,
        "email": email,
        "createDate": createDate,
        "status": status,
      };
}

class Detail {
  Detail({
    this.assignUsers,
    this.itemTerm,
    this.unitPrice,
    this.number,
    this.item,
    this.usedNumber,
    this.extendedPrice,
    this.effectiveTime,
    this.expirationTime,
    this.subItem,
    this.id,
  });

  String? assignUsers;
  int? itemTerm;
  double? unitPrice;
  int? number;
  String? item;
  int? usedNumber;
  double? extendedPrice;
  int? effectiveTime;
  int? expirationTime;
  String? subItem;
  String? id;

  factory Detail.fromJson(Map<String, dynamic> json) => Detail(
        assignUsers: json["assignUsers"],
        itemTerm: json["itemTerm"],
        unitPrice: json["unitPrice"]?.toDouble(),
        number: json["number"],
        item: json["item"],
        usedNumber: json["usedNumber"],
        extendedPrice: json["extendedPrice"]?.toDouble(),
        effectiveTime: json["effectiveTime"],
        expirationTime: json["expirationTime"],
        subItem: json["subItem"],
        id: json["id"],
      );

  Map<String, dynamic> toJson() => {
        "assignUsers": assignUsers,
        "itemTerm": itemTerm,
        "unitPrice": unitPrice,
        "number": number,
        "item": item,
        "usedNumber": usedNumber,
        "extendedPrice": extendedPrice,
        "effectiveTime": effectiveTime,
        "expirationTime": expirationTime,
        "subItem": subItem,
        "id": id,
      };
}
